import Queue from '../useSl'
import Assert from '@/utils/assets'
export const test = () => {
    const q = new Queue()
    const assert = new Assert();
    console.log(q);

    assert.type('init size').expect(q.size()).toBe(0)
    assert.type('isEmpty').expect(q.isEmpty()).toBe(true)

    q.enQueue(1)
    q.enQueue(2)
    q.enQueue(3)
    q.enQueue(4)

    assert.type('init size').expect(q.size()).toBe(4)
    assert.type('isEmpty').expect(q.isEmpty()).toBe(false)



    console.log(q.deQueue())

    // assert.type('deQueue').expect(q.deQueue()).toBe(1)
    // assert.type('deQueue').expect(q.deQueue()).toBe(2)
    // assert.type('deQueue').expect(q.deQueue()).toBe(3)
    // assert.type('init size').expect(q.size()).toBe(1)
    // assert.type('deQueue').expect(q.front()).toBe(1)
    // console.log(q)
    // q.clear();

    // print(q)



    // print(q)
}

const print = <T>(q: Queue<T>) => {
    let str = ''
    q.forEach((ele) => {
        str += `${ele} -> `
    })
    str = str.substring(0, str.length - 3)
    console.log(str)
}


